fix(oauth): harden xAI Retry-After and abort handling - #4060
Conversation
Honor bounded numeric and HTTP-date retry delays, make backoff cancellation-aware, and preserve caller aborts across response-body and custom sleep races. Closes lidge-jun#4045 Closes lidge-jun#4046 Closes lidge-jun#4047
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
⏳ DRAFT
What to do
Review readiness checklist
✅ 4/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
리뷰 · 우선순위 54 / 80이 PR은 이슈 #4045 / #4046 / #4047을 한 번에 닫는 xAI OAuth Retry-After·abort 하드닝이다. 작성자는 chilung-cgu, 베이스는 왜 지금 이 PR이 하는 일은 세 갈래다. 첫째, combo failover에 있던 HTTP-date 파서를 다만 머지 전에 게이트가 막고 있다. hygiene가 unsponsored_surface로 실패했다( 라인 98 근처(HEAD 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Summary
Retry-Afternumeric and strict HTTP-date directives with a bounded 60-second cap instead of truncating every delay to 2 seconds.src/libleaf shared with combo failover.Verification
/home/ubuntu/.bun/bin/bun test tests/providers/xai/xai-oauth-retry.test.ts— 23 pass / 0 fail./home/ubuntu/.bun/bin/bun test tests/providers/xai/xai-refresh-lock.test.ts— 10 pass / 0 fail./home/ubuntu/.bun/bin/bun test tests/oauth/oauth-refresh.test.ts— 55 pass / 0 fail./home/ubuntu/.bun/bin/bun test tests/codex-integration/combos.test.ts— 77 pass / 0 fail./home/ubuntu/.bun/bin/bun run typecheck— exit 0./home/ubuntu/.bun/bin/bun run privacy:scan— passed.git diff --check— clean.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met: